using System;
using System.Collections;
using System.Collections.Generic;
using Script.Player.ProjetctWinterState;
using TMPro;
using UnityEngine;

public class ProjectWinter : MonoBehaviour
{
   [Header("数值因子")]
   public float moveSpeedFactor;  //移动速度因子
   public float runSpeedFactor;  //奔跑速度因子
   
   public float hpFactor;  //生命上限因子
   public float hpRegenFactor;  //生命恢复因子
   public float hpDeclineFactor;  //生命衰减因子
   
   public float staminaFactor;  //体力上限因子
   public float staminaDeclineFactor; //体力衰减因子
   
   public float staminaRegenFactor; //体力恢复因子
   public float staminaRegenDelayFactor;  //体力恢复延迟因子

   public float electricityDeclineFactor;
   [Header("物品计数")]
   
   
   [Header("目前状态机")] 
   public bool isStateDataUpdate = true;
   
   public BaseWorldState currentWorldState;
  
   
   public AfternoonState AfternoonState;
   public EveningState EveningState;
   
   [Header("调试用选项")]
   public bool isPrintEquipList = false;
   public void Awake()
   {
      
      AfternoonState = new AfternoonState();
      EveningState = new EveningState();
      
      
   }

   public void Start()
   {
      currentWorldState = new AfternoonState();
      currentWorldState.EnterState(this);
   }


   public void Update()
   {
     
      currentWorldState.LogicicUpdate();
      if (!isStateDataUpdate)
      {
         hpDeclineFactor += currentWorldState.StatehpAttenuationCorrection;
         isStateDataUpdate = true;
      }
      
   } 
   
   
   

   public void ChangeState(BaseWorldState newState)
   {
      currentWorldState.ExitState();
      currentWorldState = newState;
      currentWorldState.EnterState(this);
      isStateDataUpdate = false;
   }
   
}
